<?php
include './config/config.php';
// $res;
// preg_match_all("/h/", "hello hello", $res);   //进行正则表达式全局匹配
// pre($res);


// preg_match("/^hello/","hello world",$res2);//array(1) { [0]=> string(5) "hello" }
// pre($res2);

preg_match("/world$/","hello world",$res);//array(1) { [0]=> string(11) "hello world" }

preg_match("/\W+/","asdasdasdad @ 3434",$res);//array(1) { [0]=> string(2) " " }

preg_match('/.*/', "something",$res); 
// pre($res);

$str = 'bcd 
abc 
cba'; 
preg_match_all('/^abc/m',$str,$arr);
// pre($arr);  

$str = 'adsadsa 
c'; 
preg_match_all('/a.*/s',$str,$arr2);
// pre($arr2);

$res = preg_match("/world$/", "hello world"); 
pre($res); //int(1)